<html>
<head>
<script type="text/javascript" src="utilities.js"></script>
<script type="text/javascript" src="slider-min.js"></script>
<script type="text/javascript" src="colorpicker-min.js"></script>

<script type="text/javascript">

	function majColor(){
		
		var requete = window.location.search;
		var elements = requete.split("=");
		
		var idInput = 'genform_'+elements[1];
		var idBlocColor = 'colorField_'+elements[1];
		
		var color = document.getElementById("yui-picker-hex").value;
		
		window.opener.document.getElementById(idInput).value = color;
		window.opener.document.getElementById(idBlocColor).style.backgroundColor = '#'+color;
		
		//alert(window.opener.document.getElementById(idBlocColor).style.backgroudColor);
		
	}

</script>

</head>
<body>

<link rel="stylesheet" type="text/css" href="colorpicker.css" />

<form id="formColorSelector" action="#">

	<div id="containerColor"></div>

	<div id="menu_color">
		<input id="colorSelectorBtnOk" type="button" onclick="majColor();window.close();" value="Choisir cette couleur" />
		<input type="button" onclick="window.close();" value="Fermer la fenêtre" />
	</div>
	
</form>
	
<script type="text/javascript">

		var picker = new YAHOO.widget.ColorPicker("containerColor", {
			showhsvcontrols: true,
			showhexcontrols: true,
			images: {
				PICKER_THUMB: "picker_thumb.png",
				HUE_THUMB: "hue_thumb.png"
			}
		});

</script>

</body>
</html>